package org.study.r2dbc.boot.service;

import org.study.r2dbc.boot.model.User;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.math.BigDecimal;

/**
 * 作用描述
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2025年04月02日
 */
public interface UserServiceByRepository {
    Flux<User> findAll();

    Mono<User> findById(Long id);

    Flux<User> findByName(String name);

    Flux<User> findByEmail(String email);

    Flux<User> findByAgeGreaterThan(int age);

    Mono<User> saveUser(User user);

    Mono<User> updateUser(Long id, User user);

    Mono<Void> deleteUser(Long id);

    Mono<Void> transferMoney(Long fromId, Long toId, BigDecimal amount);
}
